package action;

import java.util.ArrayList;

import DAO.Dao_Trust;
import Entity.TrustRegions;

import com.opensymphony.xwork2.ActionSupport;


public class SaveTrustRegion extends ActionSupport{
	private String nameTR;
	private String desTR;
	private String naCou;
	private boolean active; 
	
	private ArrayList<TrustRegions> list;
	
	public String execute() throws Exception{
		if (nameTR.equals("") && desTR.equals("")) {
			return "error";
		}else{
		Dao_Trust dt = new Dao_Trust();
		dt.setDsTrustRegion(nameTR, desTR, naCou, true);
		list= dt.getTrustRegions();
		return "success";
		}
	}
	
	
	
	public ArrayList<TrustRegions> getList() {
		return list;
	}

	public void setList(ArrayList<TrustRegions> list) {
		this.list = list;
	}

	public String getNameTR() {
		return nameTR;
	}

	public void setNameTR(String nameTR) {
		this.nameTR = nameTR;
	}

	public String getDesTR() {
		return desTR;
	}

	public void setDesTR(String desTR) {
		this.desTR = desTR;
	}

	public String getNaCou() {
		return naCou;
	}

	public void setNaCou(String naCou) {
		this.naCou = naCou;
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}
	
}
